
\subsection{Motivation}
\begin{frame}
  \frametitle{Introduction: Motivation}
Test-Case Generation for SQL Nested Queries with Existential Conditions\\


  \begin{itemize}
  \item Lack of tools for assist database development
  \item Test databases is difficult
    \begin{itemize}
    \item Few data in early stage of development
    \item Thousands of rows in populated databases
    \end{itemize}
  \end{itemize}
  We need small and significant database instances: Test Cases
\end{frame}

\begin{frame}
  \frametitle{Introduction: Motivation}
  Nested SQL existential subqueries
  \begin{itemize}
  \item Widely used in databases
  \item Necessary for some SQL queries
  \item Other subqueries can be translated into existential subqueries
    % cuales
  \end{itemize}
\end{frame}

\subsection{objectives}
\begin{frame}
  \frametitle{Introduction: Objectives}
  Test-Case Generation for SQL Nested Queries with Existential Conditions. 
  \begin{itemize}
  \item SQL Test Case
  \item Nested SQL queries with existential conditions

    \begin{block}{SQL Positive Test Case}
      non-empty database instances such that the query/relation studied produces a non-empty result
    \end{block}


  \end{itemize}
\end{frame}

\subsection{Approach}
\begin{frame}[fragile]
  \frametitle{Introduction: Approach}
  \begin{itemize}
  \item White-Box testing

  \item Constraint programming over a symbolic database instance \\
  \end{itemize}
  
\begin{block}{Constraint Programming}
    Uses conditions and relations over symbolic variables that constraint the possible values this variables can take.
  \end{block}
  \pause

  \begin{block}{constraint}
    First order logic formula which represents that relations and conditions over variables with an specific domain.
  \end{block}
\end{frame}
\begin{frame}[fragile]{Approach}
      %EJEMPLO
\begin{verbatim}
CREATE TABLE grades (ID int, grade int);
\end{verbatim}

  \begin{tabular}{|c|c|}
    \hline
    \textbf {ID} & \textbf {grade} \\
    \hline
    $ID_0$ & $grade_0$ \\
    $ID_1$ & $grade_1$ \\
    \hline
  \end{tabular}
  
  \begin{verbatim}
CREATE VIEW excellent (ExcellentStudentID)
AS SELECT ID FROM grades
WHERE grade >= 9 and grade <=10;
\end{verbatim}

  \begin{block}{Constraint}  

\begin{verbatim} 
((grades_grade_0 >= 9) /\ (grades_grade_0 <= 10)) 
\/ ((grades_grade_1 >= 9) /\ (grades_grade_1 <= 10));
\end{verbatim}
\end{block}
  
\end{frame}

%\subsection{Antecedentes}
%\begin{frame}
%\frametitle{Antecedentes}
%``Applying Constraint Logic Programming to SQL Test Case Generation'' por Rafael Caballero, Yolanda García-Ruiz y Fernando Sáenz-Pérez
%\begin{itemize}
%\item Caso de prueba SQL
%\item Programación con restricciones
%\end{itemize}
%\end{frame}
